package com.feng.zhihao.apigeteway.gateway.bean.impl.INTERFACE_FIELD_POSITION.RES;

import org.springframework.stereotype.Component;

import com.feng.zhihao.apigeteway.entity.InterfaceFieldInfo;
import com.feng.zhihao.apigeteway.gateway.ReqContext;
import com.feng.zhihao.apigeteway.gateway.bean.INTERFACE_FIELD_POSITION_RES;

@Component("FIELD_POSITION_RES_HTTP_HEAD")
public class FIELD_POSITION_RES_HTTP_HEAD implements INTERFACE_FIELD_POSITION_RES {

	@Override
	public void setValue(InterfaceFieldInfo interfaceFieldInfo,Object value, ReqContext reqContext) {
		reqContext.getHttpResHead().put(interfaceFieldInfo.getInterfaceFieldName(), value);
	}

	@Override
	public Object getValue(InterfaceFieldInfo interfaceFieldInfo, ReqContext reqContext) {
		return reqContext.getHttpResHead().getString(interfaceFieldInfo.getInterfaceFieldName());
	}

}
